<template>
  <div class="login-page">
      <UserFrom  @onSubmit="onSubmit" />
  </div>

</template>

<script>
import { registerAPI } from '@/api/user'
import UserFrom from '@/components/UserFrom.vue'

export default {
  name: 'Register-Page',
  components: { UserFrom },
  data () {
    return {
    }
  },
  methods: {
    async  onSubmit (values) {
      await registerAPI(values)
      this.$toast('注册成功')
      this.$router.push('/login')
    }
  }
}
</script>
